package com.bizihang.validate.code.core.support;

import com.bizihang.validate.code.core.Client;
import com.bizihang.validate.code.core.ValidateCode;

/**
 * 验证码处理器
 */
public class DefaultValidateCodeProcessorImpl extends AbstractValidateCodeProcessor {

    /**
     * 生成验证码
     *
     * @param client
     * @return
     */
    protected ValidateCode generate(Client client) {
        return new CodeGeneratorStrategy(client.getCodeType()).generate(client);
    }


    /**
     * 发送验证码
     *
     * @param code
     */
    protected void send(Client client, ValidateCode code) {
        new CodeSenderStrategy(client.getCodeType()).send(code);
    }
}
